<%--
  Created by IntelliJ IDEA.
  User: xingfuhao
  Date: 2021/5/6
  Time: 16:33
  To change this template use File | Settings | File Templates.
--%>
<%@page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>书籍列表</title>
</head>
<body>
    <h1>书籍列表</h1>
    <a href="${pageContext.request.contextPath}/addbook.html">添加书籍</a>
    <table width="90%" border="1">
        <tr>
            <th>编号</th>
            <th>书名</th>
            <th>作者</th>
            <th>出版日期</th>
            <th>出版社</th>
            <th>ISBN</th>
            <th>价格</th>
            <th>图片</th>
            <th>类别</th>
        </tr>
        <%--//items: 项目；名目；所有物品（item的复数形式）--%>
        <c:forEach items="${bl}" var="book">
            <tr>
                <td>${book.id}</td>
                <td>${book.title}</td>
                <td>${book.author}</td>
                <td><fmt:formatDate value="${book.publicDate}" pattern="yyyy-mm-dd"></fmt:formatDate></td>
                <td>${book.publisher}</td>
                <td>${book.isbn}</td>
                <td>${book.price}</td>
                <td>${book.picture}</td>
                <td>${book.cid}</td>
                <td>
                    <c:url var="updateurl" value="updateui">
                        <c:param name="id" value="${book.id}"></c:param>
                    </c:url>
                    <a href="${updateurl}">更新</a>


                    <c:url var="deleteurl" value="delete">
                        <c:param name="id" value="${book.id}"></c:param>
                    </c:url>
                    <a onclick="return confirm('确定要删除吗')" href="${deleteurl}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</body>
</html>
